ci: add SonarQube analysis with coverage#3
Merged
Conversation
Adds a coverage job that generates Clover + JUnit reports and a sonar job that calls the shared Accredify sonar-scan reusable workflow, following Accredifysg/VerifiableCredentials-PHP#32. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Public repos cannot call a reusable workflow hosted in an internal repo, so replicate the sonar-scan steps inline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fold coverage into the existing unit test matrix job (no separate coverage process), make ci.yml a reusable workflow, and split triggers into main.yml (push -> ci + sonar) and pull-request.yml (PR -> actionlint + ci). Adds actionlint workflow linting. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Runs Sonar on PRs to validate the setup before relying on main.yml. To be removed once confirmed working on main. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the branches: [main] filter so the workflow runs on PRs to any base branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
abbavivek
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds SonarQube static analysis with unit-test coverage, plus GitHub Actions workflow linting. Coverage is generated by the existing unit-test suite (no separate coverage process), and analysis paths are configured in
sonar-project.properties.Changes
CI workflow (
.github/workflows/ci.yml)workflow_call) that exposes the coverage and JUnit artifact names as outputs.pcov): Pest emitscoverage/clover.xmlandcoverage/junit.xml, absolute paths are normalized, and both are uploaded as per-PHP-version artifacts. SonarQube consumes the latest PHP version's reports.Main workflow (
.github/workflows/main.yml, new)main. Runsci, then asonarjob that downloads the coverage/JUnit artifacts and runsSonarSource/sonarqube-scan-actionon a GitHub-hosted runner.Pull request workflow (
.github/workflows/pull-request.yml, new)actionlintto lint workflow files, andci.Sonar config (
sonar-project.properties, new)Accredifysg_PHP-RDF-Canonicalize. Points PHP coverage atcoverage_BE/clover.xmland tests atjunit_BE/junit.xml, with those artifact directories excluded from analysis.Notes
SONAR_TOKENandSONAR_HOST_URLrepository secrets. The GitHub-hosted runner must be able to reach the configuredSONAR_HOST_URL.